<extend name="Home@Include:Layout"/>
<block name="title">暑期班报名</block>
<block name="style">

</block>

<block name="main">
	<div class="weui_tab">
		<div class="weui_navbar">
			<div class="toolbar">
		        <div class="toolbar-inner">
		            <a href="javascript:history.go(-1);" class="picker-button close-popup">返回</a>
		             <h1 class="title" id="banji_title">暑期班报名</h1> 
		        </div>
		    </div>
		</div>
		<div class="weui_tab_bd container" id="container" style="padding-top:44px;">
			<div class="weui_cells weui_cells_form" style="margin-top:10px;">
				<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">学生姓名</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						{$info.stuname}
					</div>
				</div>
				<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">联系方式</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						{$info.tel}
					</div>
				</div>
				<div class="weui_cell">
			     <div class="weui_cell_hd"><label class="weui_label">校区</label></div>
			     <div class="weui_cell_bd weui_cell_primary">
			       {$info.xiaoqu.title}
			     </div>
			    </div>
				<div class="weui_cell">
			     <div class="weui_cell_hd"><label class="weui_label">金额</label></div>
			     <div class="weui_cell_bd weui_cell_primary">
			       {$info.total}
			     </div>
			    </div>
				<div class="weui_cell banjiDom">
				    <div class="weui_cell_hd"><label class="weui_label">备注信息</label></div>
				    <div class="weui_cell_bd weui_cell_primary">
				    	{$info.objectinfo}
				    </div>
				  </div>
				
			</div>
			<eq name="info['status']" value="2">
			<div style="padding:15px;">
				<button class="weui_btn weui_btn_primary weixinPayBtn">支付</button>
			</div>
			</eq>
		</div>
	</div>
</block>

<block name="script">
<script>
$(".weixinPayBtn").on('click',function(){
	callpay();
})
function jsApiCall(){
	WeixinJSBridge.invoke(
		'getBrandWCPayRequest',
		<?php echo $jsApiParameters; ?>,
		function(res){
			//如果支付成功
			if (res.err_msg == 'get_brand_wcpay_request:ok') {
				$.alert('支付成功', function(){
					location.href='/home/my/index';
		        });
			}else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
				$.toast('请尽快完成支付哦！','text');
			}else if (res.err_msg == 'get_brand_wcpay_request:fail') {
				$.toast('支付失败','text');
			}else {
				$.toast('意外错误','text');
			}
		}
	);
}
function callpay(){
	if (typeof WeixinJSBridge == "undefined"){
	    if( document.addEventListener ){
	        document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
	    }else if (document.attachEvent){
	        document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
	        document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
	    }
	}else{
	    jsApiCall();
	}
}
</script>
</block>